<% @post_tag = Zerocms::PostTag.new if @post_tag.nil? %>
<%= form_for @post_tag, as: "post_tag", url:{action: @post_tag.new_record? ? :create : :update} , html:{class: 'validate-post-tag zerocms_ajax_request'} do |f| %>
    <%= f.hidden_field :parent_id  %>
    <%= f.hidden_field :taxonomy %>
    <div class="panel-body">
      <%= render partial: 'layouts/zerocms/admin/form_error', locals: {data: @post_tag} %>
        <div class="form-group">
          <%= f.label t('zerocms.admin.table.name') %><br>
          <%= f.text_field :name, :class => "form-control required translatable" %>
        </div>
        <div class="form-group">
            <%= f.label t('zerocms.admin.table.slug') %><br>
            <%= f.text_field :slug, :class => "form-control no_translate required slug", "data-parent" => "post_tag_name" %>
        </div>

        <div class="form-group">
          <%= f.label t('zerocms.admin.table.description') %><br>
          <%= f.text_area :description, :class => "form-control", :rows => 4 %>
        </div>
        <%= render partial: "zerocms/admin/settings/custom_fields/render", locals: {record: @post_tag, field_groups: @post_type.get_field_groups({kind: "PostTag"})} %>
    </div>
    <div class="panel-footer">
      <a class="btn btn-default" role="back" href="<%= url_for action: :index %>"><%= t('zerocms.admin.button.back') %></a>
      <button class="btn btn-primary pull-right" type="submit"><%= t('zerocms.admin.button.submit')%></button>
    </div>
<% end %>
